package com.gateway.security.common.authorization;

import com.gateway.common.dto.ApiDefinition;
import org.springframework.security.authorization.AuthorizationDecision;
import org.springframework.security.core.Authentication;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @program: api-gateway
 * @description:
 * @author: YuKai Fan
 * @create: 2025/2/11 22:47
 **/
public interface AuthorizationChecker {

    /**
     * 鉴权
     * @param authentication
     * @param exchange
     * @param apiDefinition
     * @return
     */
    Mono<AuthorizationDecision> check(Mono<Authentication> authentication, ServerWebExchange exchange, ApiDefinition apiDefinition);
}
